<template lang="html">
  <div class="spike">
    <div class="spike_title">
      <span class="title_txt">限时秒杀</span>
      <div class="time_down">
        <span class="time">12</span>
        <span>:</span>
        <span class="time">22</span>
        <span>:</span>
        <span class="time">21</span>
      </div>
    </div>
    <div class="spike_list">
      <div class="spike_list_item" v-for="(item, key) in prd_list" v-bind:key="key">
        <div class="spike_top">
          <!-- <van-tag mark type="primary" custom-class="spike_tag" color="#E91F3F">6.5折</van-tag> -->
          <img :src="item.product_image" class="spike_img"  mode="aspectFit"/>
        </div>
        <span class="spike_item_title">{{item.product_short_name}}</span>
        <div class="price" v-if="!is_vip">
          <span class="new_money">¥{{item.item_discount_price}}</span>
          <span class="old_money">¥{{item.item_unit_price}}</span>
        </div>
         <div class="vip_price" v-if="is_vip">
         <span class="new_money">¥</span>
          <span class="new_money num">{{item.item_discount_price}}</span>
          <span class="price_hr" v-if="item.discount">/</span>
          <span class="old_money"  v-if="item.discount">赚</span>
          <span class="old_money num" v-if="item.discount">{{item.discount}}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      // item: {},
      prd_list: [],
      is_vip: false
    }
  },
  created () {
    this.getSpike()
  },

  methods: {
    getSpike () {
      return new Promise((resolve, reject) => {
        this.$Axios({ url: 'limit_sale', params: { is_index: 'Y' }, method: 'get' }).then((resp) => { // 请求成功
          if (resp.return_code === '0000') {
            this.prd_list = resp.data.list
          }
          resolve(resp)
        }).catch((error) => { // 请求失败
          this.$_requestInterceptor('error', error)
          reject(error)
        })
      })
    }
  }
}
</script>

<style lang="css" scoped>
</style>
